import Vue from 'vue'
import Router from 'vue-router'


import Msite from '../pages/Msite/Msite.vue'
import Order from '../pages/Order/Order.vue'
import Profile from '../pages/Profile/Profile.vue'
import Search from '../pages/Search/Search.vue'
import Login from '../pages/Login/Login.vue'
import Shop from '@/pages/Shop/Shop.vue'
import ShopGoods from '@/pages/Shop/ShopGoods/ShopGoods.vue'
import ShopRatings from '@/pages/Shop/ShopRating/ShopRating.vue'
import ShopInfo from '@/pages/Shop/ShopInfo/ShopInfo.vue'
Vue.use(Router)


export default new Router({
    mode: 'history',
    routes: [{
            path: '/',
            redirect: '/msite'
        },
        {
            path: '/msite',
            component: Msite,
            meta: { requiresAuth: true }
        },
        {
            path: '/search',
            component: Search,
            meta: { requiresAuth: true }
        },
        {
            path: '/order',
            component: Order,
            meta: { requiresAuth: true }
        },
        {
            path: '/profile',
            component: Profile,
            meta: { requiresAuth: true }
        }, {
            path: '/login',
            component: Login,
        }, {
            path: '/shop',
            component: Shop,
            children: [{
                    path: '',
                    redirect: '/shop/goods'
                }, {
                    path: '/shop/goods',
                    component: ShopGoods
                },
                {
                    path: '/shop/ratings',
                    component: ShopRatings
                }, {
                    path: '/shop/info',
                    component: ShopInfo
                }
            ]
        }
    ]
})